<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        //分配前台菜单数据
        $nav = config('other.nav');

        view()->composer('index.home.index',function($view) use ($nav){
            $view->with('nav', $nav);
        });
        view()->composer('index.layouts.header',function($view) use ($nav){
            $view->with('nav', $nav);
        });


    }
}
